package cn.cljh.day7_20.task;

public class Test4 {
    public static void main(String[] args) {
        for (int i = 1; i <= 10; i++) {
            int r = sum(i);
            if (r>20){
                System.out.println(i);
                break;
            }

        }
    }
    public static int sum(int n){
        if(n < 1)
            return 1;
        return sum(n-1) + n;
    }
}
